package com.josework.springhelloworld.entity;

public class AppleWeightPrint2 implements ApplePrint{
    @Override
    public String accept(Apple apple) {
        AppleHeavyWeightPredicate p = new AppleHeavyWeightPredicate();
        String isHeavy = p.test(apple) ? "heavy" : "light";
        return "The weight of the apple is "+apple.getWeight()+" it is "+isHeavy+";";
    }
}
